<?php
/**
 +------------------------------------------------------------------------------
 * CatModel数据映射对象
 +------------------------------------------------------------------------------
 * @category   SubModel
 * @package  bi
 * @subpackage  Action
 * @author   朝闻道 <hydata@gmail.com>
 * @date  2010-8-22
 * @time  下午01:25:57
 +------------------------------------------------------------------------------
 */
import("RelationModel");
class ArcModel extends RelationModel{
	protected $_auto=array(
		array('xnum','xnum',1,'function'),
		array('ctime','time',1,'function'),
		array('is_show','1',1),
		array('password','ptime',1,'function'),
		array('activetime','time',1,'function'),
	);
	protected $_validate=array(
		array('cid','require','栏目必须选择!'),
		array('cname','require','站点名称英文必填'),
		array('ename','require','站点名称英文必填'),
	);
	
	protected $_link = array(
		'ArcLang'=>array(//中文信息
				//ONE_TO_ONE(HAS_ONE/BELONGS_TO)、ONE_TO_MANY(HAS_MANY/BELONGS_TO)、  MANY_TO_MANY
				//HAS_ONE',1;BELONGS_TO',2;HAS_MANY',3;MANY_TO_MANY',4;
				'mapping_type'=>2,
				'class_name'=>'ArcLang',
		        'foreign_key'=>'aid',
		        'mapping_name'=>'lang',
		        //'mapping_order'=>'ctime desc'
			),
		'Product'=>array(//产品
				//ONE_TO_ONE(HAS_ONE/BELONGS_TO)、ONE_TO_MANY(HAS_MANY/BELONGS_TO)、  MANY_TO_MANY
				'mapping_type'=>4,
				'class_name'=>'Product',
		        'foreign_key'=>'aid',
		        'mapping_name'=>'product',
		        //'mapping_order'=>'ctime desc'
			),
		'Deep'=>array(//深度链接
				//ONE_TO_ONE(HAS_ONE/BELONGS_TO)、ONE_TO_MANY(HAS_MANY/BELONGS_TO)、  MANY_TO_MANY
				'mapping_type'=>4,
				'class_name'=>'Deep',
		        'foreign_key'=>'aid',
		        'mapping_name'=>'deep',
		        //'mapping_order'=>'ctime desc'
			),
		'News'=>array(//新闻
				//ONE_TO_ONE(HAS_ONE/BELONGS_TO)、ONE_TO_MANY(HAS_MANY/BELONGS_TO)、  MANY_TO_MANY
				'mapping_type'=>4,
				'class_name'=>'News',
		        'foreign_key'=>'aid',
		        'mapping_name'=>'news',
		        //'mapping_order'=>'ctime desc'
			),
		'Ext'=>array(//关联扩展表
				//ONE_TO_ONE(HAS_ONE/BELONGS_TO)、ONE_TO_MANY(HAS_MANY/BELONGS_TO)、  MANY_TO_MANY
				'mapping_type'=>1,
				'class_name'=>'Ext',
		        'foreign_key'=>'aid',
		        'mapping_name'=>'ext',
		        //'mapping_order'=>'ctime desc'
			),
		'Pic'=>array(//关联图片表
				//ONE_TO_ONE(HAS_ONE/BELONGS_TO)、ONE_TO_MANY(HAS_MANY/BELONGS_TO)、  MANY_TO_MANY
				'mapping_type'=>4,
				'class_name'=>'Pic',
		        'foreign_key'=>'aid',
		        'mapping_name'=>'pic',
		        //'mapping_order'=>'ctime desc'
			),
		);
}
?>